//
//  Login.m
//  OC
//
//  Created by MacBook on 16-4-14.
//  Copyright (c) 2016年 ZHD. All rights reserved.
//

#import "Login.h"

@implementation Login
{
    NSString *name;
    NSString *passwd;
}
-(void)getname{
    NSLog(@"请输入用户名:");
    char *name_ =malloc(20);
    scanf("%s ",name_);
    name =[[NSString alloc]initWithCString:name_encoding:NSUTF8StringEncoding];
    [self getpasswd];
}
-(void)getpasswd{
    NSLog(@"请输入密码:");
    char *pass=malloc(20);
    scanf("%s",pass);
    passwd=[[NSString alloc]initWithCString:pass encoding:NSUTF8StringEncoding];
    if([name isEqualToString:@"test"]&&[passwd isEqualToString:@"123"]){
        NSLog(@"登录成功");
        [self.delegate loginWithName:name passwd:passwd success : YES];
    } else{
            NSLog(@"登录失败");
            [self.delegate loginWithName: name passwd:passwd success: NO];
        
        }
    
}
@end
